﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 3.1
// Code is generated on: Thursday, June 23, 2011 1:28:25 PM
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Data;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace MyHealthOnline.Dal.Generated.HelperClasses
{
	/// <summary>Singleton implementation of the PersistenceInfoProvider. This class is the singleton wrapper through which the actual instance is retrieved.</summary>
	/// <remarks>It uses a single instance of an internal class. The access isn't marked with locks as the PersistenceInfoProviderBase class is threadsafe.</remarks>
	internal static class PersistenceInfoProviderSingleton
	{
		#region Class Member Declarations
		private static readonly IPersistenceInfoProvider _providerInstance = new PersistenceInfoProviderCore();
		#endregion

		/// <summary>Dummy static constructor to make sure threadsafe initialization is performed.</summary>
		static PersistenceInfoProviderSingleton()
		{
		}

		/// <summary>Gets the singleton instance of the PersistenceInfoProviderCore</summary>
		/// <returns>Instance of the PersistenceInfoProvider.</returns>
		public static IPersistenceInfoProvider GetInstance()
		{
			return _providerInstance;
		}
	}

	/// <summary>Actual implementation of the PersistenceInfoProvider. Used by singleton wrapper.</summary>
	internal class PersistenceInfoProviderCore : PersistenceInfoProviderBase
	{
		/// <summary>Initializes a new instance of the <see cref="PersistenceInfoProviderCore"/> class.</summary>
		internal PersistenceInfoProviderCore()
		{
			Init();
		}

		/// <summary>Method which initializes the internal datastores with the structure of hierarchical types.</summary>
		private void Init()
		{
			this.InitClass((14 + 0));
			InitAdministratorEntityMappings();
			InitAppProposalEntityMappings();
			InitConsultEntityMappings();
			InitConsultQuestionEntityMappings();
			InitDateQuestionEntityMappings();
			InitDisciplineEntityMappings();
			InitMessageEntityMappings();
			InitMultiChoiceQuestionEntityMappings();
			InitOpenQuestionEntityMappings();
			InitPatientEntityMappings();
			InitQuestionEntityMappings();
			InitQuestionnaireEntityMappings();
			InitQuestionnaireQuestionEntityMappings();
			InitSpecialistEntityMappings();

		}


		/// <summary>Inits AdministratorEntity's mappings</summary>
		private void InitAdministratorEntityMappings()
		{
			this.AddElementMapping( "AdministratorEntity", "WebConsult", @"dbo", "Administrator", 8 );
			this.AddElementFieldMapping( "AdministratorEntity", "Address", "Address", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "AdministratorEntity", "City", "City", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "AdministratorEntity", "Country", "Country", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 2 );
			this.AddElementFieldMapping( "AdministratorEntity", "Email", "Email", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 3 );
			this.AddElementFieldMapping( "AdministratorEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 4 );
			this.AddElementFieldMapping( "AdministratorEntity", "Name", "Name", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 5 );
			this.AddElementFieldMapping( "AdministratorEntity", "Password", "Password", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 6 );
			this.AddElementFieldMapping( "AdministratorEntity", "Phone", "Phone", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 7 );
		}
		/// <summary>Inits AppProposalEntity's mappings</summary>
		private void InitAppProposalEntityMappings()
		{
			this.AddElementMapping( "AppProposalEntity", "WebConsult", @"dbo", "AppProposal", 4 );
			this.AddElementFieldMapping( "AppProposalEntity", "ConsultId", "ConsultId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 0 );
			this.AddElementFieldMapping( "AppProposalEntity", "Description", "Description", true, "NVarChar", 1024, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "AppProposalEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 2 );
			this.AddElementFieldMapping( "AppProposalEntity", "NextWebConsultDate", "NextWebConsultDate", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 3 );
		}
		/// <summary>Inits ConsultEntity's mappings</summary>
		private void InitConsultEntityMappings()
		{
			this.AddElementMapping( "ConsultEntity", "WebConsult", @"dbo", "Consult", 13 );
			this.AddElementFieldMapping( "ConsultEntity", "Conclusion", "Conclusion", true, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "ConsultEntity", "ConsultDate", "ConsultDate", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 1 );
			this.AddElementFieldMapping( "ConsultEntity", "CreationDate", "CreationDate", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 2 );
			this.AddElementFieldMapping( "ConsultEntity", "DueToBeSent", "DueToBeSent", true, "NVarChar", 10, 0, 0, false, "", null, typeof(System.String), 3 );
			this.AddElementFieldMapping( "ConsultEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 4 );
			this.AddElementFieldMapping( "ConsultEntity", "InitialComment", "InitialComment", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 5 );
			this.AddElementFieldMapping( "ConsultEntity", "LatestContact", "LatestContact", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 6 );
			this.AddElementFieldMapping( "ConsultEntity", "LetterStatus", "LetterStatus", true, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 7 );
			this.AddElementFieldMapping( "ConsultEntity", "PatientId", "PatientId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 8 );
			this.AddElementFieldMapping( "ConsultEntity", "PersonalNotes", "PersonalNotes", true, "NVarChar", 1024, 0, 0, false, "", null, typeof(System.String), 9 );
			this.AddElementFieldMapping( "ConsultEntity", "SpecialistId", "SpecialistId", true, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 10 );
			this.AddElementFieldMapping( "ConsultEntity", "Status", "Status", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 11 );
			this.AddElementFieldMapping( "ConsultEntity", "Summary", "Summary", true, "NVarChar", 1024, 0, 0, false, "", null, typeof(System.String), 12 );
		}
		/// <summary>Inits ConsultQuestionEntity's mappings</summary>
		private void InitConsultQuestionEntityMappings()
		{
			this.AddElementMapping( "ConsultQuestionEntity", "WebConsult", @"dbo", "ConsultQuestion", 4 );
			this.AddElementFieldMapping( "ConsultQuestionEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			this.AddElementFieldMapping( "ConsultQuestionEntity", "ConsultId", "ConsultId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 1 );
			this.AddElementFieldMapping( "ConsultQuestionEntity", "QuestionId", "QuestionId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 2 );
			this.AddElementFieldMapping( "ConsultQuestionEntity", "Text", "Text", true, "NVarChar", 1024, 0, 0, false, "", null, typeof(System.String), 3 );
		}
		/// <summary>Inits DateQuestionEntity's mappings</summary>
		private void InitDateQuestionEntityMappings()
		{
			this.AddElementMapping( "DateQuestionEntity", "WebConsult", @"dbo", "DateQuestion", 3 );
			this.AddElementFieldMapping( "DateQuestionEntity", "Answer", "Answer", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 0 );
			this.AddElementFieldMapping( "DateQuestionEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 1 );
			this.AddElementFieldMapping( "DateQuestionEntity", "QuestionId", "QuestionId", false, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 2 );
		}
		/// <summary>Inits DisciplineEntity's mappings</summary>
		private void InitDisciplineEntityMappings()
		{
			this.AddElementMapping( "DisciplineEntity", "WebConsult", @"dbo", "Discipline", 3 );
			this.AddElementFieldMapping( "DisciplineEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			this.AddElementFieldMapping( "DisciplineEntity", "Title", "Title", false, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "DisciplineEntity", "Informations", "Informations", true, "NVarChar", 2147483647, 0, 0, false, "", null, typeof(System.String), 2 );
		}
		/// <summary>Inits MessageEntity's mappings</summary>
		private void InitMessageEntityMappings()
		{
			this.AddElementMapping( "MessageEntity", "WebConsult", @"dbo", "Message", 8 );
			this.AddElementFieldMapping( "MessageEntity", "ConsultId", "ConsultId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 0 );
			this.AddElementFieldMapping( "MessageEntity", "CreationDate", "CreationDate", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 1 );
			this.AddElementFieldMapping( "MessageEntity", "FromSpecialist", "FromSpecialist", false, "Bit", 0, 0, 0, false, "", null, typeof(System.Boolean), 2 );
			this.AddElementFieldMapping( "MessageEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 3 );
			this.AddElementFieldMapping( "MessageEntity", "Reply", "Reply", false, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 4 );
			this.AddElementFieldMapping( "MessageEntity", "ResponseDate", "ResponseDate", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 5 );
			this.AddElementFieldMapping( "MessageEntity", "Status", "Status", true, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 6 );
			this.AddElementFieldMapping( "MessageEntity", "Text", "Text", false, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 7 );
		}
		/// <summary>Inits MultiChoiceQuestionEntity's mappings</summary>
		private void InitMultiChoiceQuestionEntityMappings()
		{
			this.AddElementMapping( "MultiChoiceQuestionEntity", "WebConsult", @"dbo", "MultiChoiceQuestion", 5 );
			this.AddElementFieldMapping( "MultiChoiceQuestionEntity", "Answer", "Answer", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "MultiChoiceQuestionEntity", "Choices", "Choices", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "MultiChoiceQuestionEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 2 );
			this.AddElementFieldMapping( "MultiChoiceQuestionEntity", "PatientRemarks", "PatientRemarks", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 3 );
			this.AddElementFieldMapping( "MultiChoiceQuestionEntity", "QuestionId", "QuestionId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 4 );
		}
		/// <summary>Inits OpenQuestionEntity's mappings</summary>
		private void InitOpenQuestionEntityMappings()
		{
			this.AddElementMapping( "OpenQuestionEntity", "WebConsult", @"dbo", "OpenQuestion", 3 );
			this.AddElementFieldMapping( "OpenQuestionEntity", "Answer", "Answer", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "OpenQuestionEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 1 );
			this.AddElementFieldMapping( "OpenQuestionEntity", "QuestionId", "QuestionId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 2 );
		}
		/// <summary>Inits PatientEntity's mappings</summary>
		private void InitPatientEntityMappings()
		{
			this.AddElementMapping( "PatientEntity", "WebConsult", @"dbo", "Patient", 11 );
			this.AddElementFieldMapping( "PatientEntity", "Address", "Address", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "PatientEntity", "Birthday", "Birthday", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 1 );
			this.AddElementFieldMapping( "PatientEntity", "City", "City", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 2 );
			this.AddElementFieldMapping( "PatientEntity", "Country", "Country", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 3 );
			this.AddElementFieldMapping( "PatientEntity", "Email", "Email", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 4 );
			this.AddElementFieldMapping( "PatientEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 5 );
			this.AddElementFieldMapping( "PatientEntity", "Name", "Name", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 6 );
			this.AddElementFieldMapping( "PatientEntity", "Number", "Number", false, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 7 );
			this.AddElementFieldMapping( "PatientEntity", "Password", "Password", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 8 );
			this.AddElementFieldMapping( "PatientEntity", "Phone", "Phone", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 9 );
			this.AddElementFieldMapping( "PatientEntity", "Sex", "Sex", true, "NVarChar", 8, 0, 0, false, "", null, typeof(System.String), 10 );
		}
		/// <summary>Inits QuestionEntity's mappings</summary>
		private void InitQuestionEntityMappings()
		{
			this.AddElementMapping( "QuestionEntity", "WebConsult", @"dbo", "Question", 6 );
			this.AddElementFieldMapping( "QuestionEntity", "AnswerDate", "AnswerDate", true, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 0 );
			this.AddElementFieldMapping( "QuestionEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 1 );
			this.AddElementFieldMapping( "QuestionEntity", "IsDatabaseQuestion", "IsDatabaseQuestion", false, "Bit", 0, 0, 0, false, "", null, typeof(System.Boolean), 2 );
			this.AddElementFieldMapping( "QuestionEntity", "QuestionDate", "QuestionDate", false, "DateTime", 0, 0, 0, false, "", null, typeof(System.DateTime), 3 );
			this.AddElementFieldMapping( "QuestionEntity", "QuestionText", "QuestionText", true, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 4 );
			this.AddElementFieldMapping( "QuestionEntity", "Type", "Type", false, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 5 );
		}
		/// <summary>Inits QuestionnaireEntity's mappings</summary>
		private void InitQuestionnaireEntityMappings()
		{
			this.AddElementMapping( "QuestionnaireEntity", "WebConsult", @"dbo", "Questionnaire", 2 );
			this.AddElementFieldMapping( "QuestionnaireEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			this.AddElementFieldMapping( "QuestionnaireEntity", "QuestionId", "QuestionId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 1 );
		}
		/// <summary>Inits QuestionnaireQuestionEntity's mappings</summary>
		private void InitQuestionnaireQuestionEntityMappings()
		{
			this.AddElementMapping( "QuestionnaireQuestionEntity", "WebConsult", @"dbo", "QuestionnaireQuestion", 3 );
			this.AddElementFieldMapping( "QuestionnaireQuestionEntity", "Id", "Id", false, "Int", 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			this.AddElementFieldMapping( "QuestionnaireQuestionEntity", "QuestionId", "QuestionId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 1 );
			this.AddElementFieldMapping( "QuestionnaireQuestionEntity", "QuestionnaireId", "QuestionnaireId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 2 );
		}
		/// <summary>Inits SpecialistEntity's mappings</summary>
		private void InitSpecialistEntityMappings()
		{
			this.AddElementMapping( "SpecialistEntity", "WebConsult", @"dbo", "Specialist", 12 );
			this.AddElementFieldMapping( "SpecialistEntity", "Address", "Address", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "SpecialistEntity", "Birthday", "Birthday", true, "NVarChar", 10, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "SpecialistEntity", "City", "City", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 2 );
			this.AddElementFieldMapping( "SpecialistEntity", "Country", "Country", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 3 );
			this.AddElementFieldMapping( "SpecialistEntity", "DisciplineId", "DisciplineId", true, "Int", 0, 0, 10, false, "", null, typeof(System.Int32), 4 );
			this.AddElementFieldMapping( "SpecialistEntity", "Email", "Email", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 5 );
			this.AddElementFieldMapping( "SpecialistEntity", "Id", "Id", false, "NVarChar", 50, 0, 0, false, "", null, typeof(System.String), 6 );
			this.AddElementFieldMapping( "SpecialistEntity", "Name", "Name", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 7 );
			this.AddElementFieldMapping( "SpecialistEntity", "Organization", "Organization", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 8 );
			this.AddElementFieldMapping( "SpecialistEntity", "Password", "Password", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 9 );
			this.AddElementFieldMapping( "SpecialistEntity", "Phone", "Phone", true, "NVarChar", 255, 0, 0, false, "", null, typeof(System.String), 10 );
			this.AddElementFieldMapping( "SpecialistEntity", "Sex", "Sex", true, "NVarChar", 8, 0, 0, false, "", null, typeof(System.String), 11 );
		}

	}
}